import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/pages/login'
import Layout from '@/components/pages/layout'
import Main from '@/components/pages/main'
import Projects from '@/components/pages/projects'
import SubProjects from '@/components/pages/subprojects'
import Project from '@/components/pages/project'
import Step1 from '@/components/pages/projectSteps/step1'
import Step2 from '@/components/pages/projectSteps/step2'
import Step3 from '@/components/pages/projectSteps/step3'
import ProjectsUsers from '@/components/pages/projectsusers'
import LccInformation from '@/components/pages/lccInformation'
import BoxInformation from '@/components/pages/boxInformation'
import fanganUpdate from '@/components/pages/fanganupdate'
import LccDianweituUpdate from '@/components/pages/lccdianweituupdate'
import BoxDianweituUpdate from '@/components/pages/boxdianweituupdate'
import baogaoUpdate from '@/components/pages/baogaoupdate'
import gongzuoUpdate from '@/components/pages/gongzuoupdate'
import wendangUpdate from '@/components/pages/wendangupdate'
import yuanshishujuUpdate from '@/components/pages/yuanshishujuupdate'
import User from '@/components/pages/users/user'
import Customer from '@/components/pages/users/customer'
import Other from '@/components/pages/other'
import NotFound from '@/components/errorPage/404'
import NoPermission from '@/components/errorPage/401'

Vue.use(Router)

export const constantRouterMap = [{

    path: '/login',
    component: Login,
    hidden: true
  },
  {
    path: '/404',
    component: NotFound,
    hidden: true
  },
  {
    path: '/401',
    component: NoPermission,
    hidden: true
  },
  {
    path: '/',
    redirect: '/Main',
    component: Layout,
    children: [{
        path: '/Main',
        name: 'Main',
        component: Main,
        meta: {
          title: "首页"
        },
      },
      {
        path: '/Project',
        name: 'Project',
        redirect: '/Project/Projects',
        meta: {
          title: "项目列表",
        },
        component: Project,
        children: [{
            path: 'Projects',
            name: 'Projects',
            component: Projects,
            meta: {
              title: "项目列表",
            },
          },
          {
            path: 'SubProjects',
            name: 'SubProjects',
            redirect: '/Project/SubProjects/:groupid',
            component: Project,
            meta: {
              title: "子项目",
            },
            children: [{
                path: ':groupid',
                name: 'Subject',
                meta: {
                  title: "子项目列表",
                },
                component: SubProjects,
              },
              {
                path: 'ProjectsUsers/:projectid',
                name: 'ProjectsUsers',
                component: ProjectsUsers,
                meta: {
                  title: '项目负责人',
                }
              },
              {
                path: 'LccInformation/:projectid',
                name: 'LccInformation',
                component: LccInformation,
                meta: {
                  title: '冷藏车验证信息',
                }
              },
              {
                path: 'BoxInformation/:projectid',
                name: 'BoxInformation',
                component: BoxInformation,
                meta: {
                  title: '保温箱验证信息',
                }
              },
              {
                path: 'baogaoUpdate/:projectid',
                name: 'baogaoUpdate',
                component: baogaoUpdate,
                meta: {
                  title: '报告上传',
                }
              },
              {
                path: 'LccDianweituUpdate/:projectid',
                name: 'LccDianweituUpdate',
                component: LccDianweituUpdate,
                meta: {
                  title: '冷藏车点位图信息',
                }

              },
              {
                path: 'BoxDianweituUpdate/:projectid',
                name: 'BoxDianweituUpdate',
                component: BoxDianweituUpdate,
                meta: {
                  title: '保温箱点位图信息',
                }

              },
              {
                path: 'fanganUpdate/:projectid',
                name: 'fanganUpdate',
                component: fanganUpdate,
                meta: {
                  title: '方案信息',
                }
              },
              {
                path: 'gongzuoUpdate/:projectid',
                name: 'gongzuoUpdate',
                component: gongzuoUpdate,
                meta: {
                  title: '现场验证工作',
                }
              },
              {
                path: 'wendangUpdate/:projectid',
                name: 'wendangUpdate',
                component: wendangUpdate,
                meta: {
                  title: "纸质验证文档信息"
                }
              },
              {
                path: 'yuanshishujuUpdate/:projectid',
                name: 'yuanshishujuUpdate',
                component: yuanshishujuUpdate,
                meta: {
                  title: "原始数据上传信息"
                }
              },
            ]
          },
        ]
      },

      {
        path: '/User',
        name: '用户管理',
        component: User
      },
      {
        path: '/Customer',
        name: '客户管理',
        component: Customer
      },
      {
        path: '/Other',
        name: '其他',
        component: Other
      }
    ]

  }
]


export default new Router({
  mode: 'hash',
  routes: constantRouterMap
})
